#ifndef __GAMEHACK_GAMEHACK_H__
#define __GAMEHACK_GAMEHACK_H__
#include <windows.h>
#include <boost/filesystem.hpp>
#include "singleton.hpp"
#include "../tcc-0.9.26/libtcc.h"

class GameHack :public core::Singleton<GameHack>
{
	friend core::Singleton<GameHack>;
private:
	GameHack()
		: dll_hadle_(NULL), is_initialized_(false), tcc_(NULL)
	{}
	~GameHack()
	{}
public:
	bool Initialize(HINSTANCE dll_hanlde);
	void Finalize();
	HHOOK InstallHook(DWORD dwThreadID,char* pUserName,char* pRegCode);
	BOOL UninstallHook(HHOOK hHook);
	LRESULT HookProc(int nCode,WPARAM wParam,LPARAM lParam);
private:
	bool InitScriptEngine();
	void ProcessCmd(std::string& cmd);
private:
	HINSTANCE dll_hadle_;
	boost::filesystem::path dll_path_;
	bool is_initialized_;
	TCCState *tcc_;
};
#define sGameHack GameHack::GetInstance()
#endif//__GAMEHACK_GAMEHACK_H__